================================================================================
                                样例使用说明
                             Sample Description
================================================================================
功能描述：
此样例演示了USB自定义HID功能。
此样例主要是借助USB HID类实现，将其设置为一个自定义HID设备。在PC端，打开上位机软
件，选择该自定义HID设备，可以观察到VID、PID、报告描述符长度等基本信息，打开上位
机软件中定时接收数据开关，软件窗口中会不断接收并打印设备发送的databuffer数组中的
数据。同时通过上位机软件可以给设备发送数据，设备接收到的数据会写入并更新
databuffer数组，下一次上位机软件将接收到更新后的databuffer数组数据。

Function descriptions:
This sample demonstrates the functionality of a custom USB HID device.
This sample primarily utilizes the USB HID class to implement a custom HID
device. On the PC side, after opening the host computer software and selecting
this custom HID device, basic information such as VID, PID, and report descriptor
length can be observed. Turning on the timed data reception switch in the host
software causes the software window to continuously receive and print the data
from the databuffer array. Simultaneously, data can be sent to the device
through the host software. The data received by the device is written into and
updates the databuffer array, and the host software will receive this updated
databuffer data during the next reception cycle.
================================================================================
测试环境：
测试用板：STK
MDK版本：5.28
IAR版本： 9.20
GCC 版本：GNU Arm Embedded Toolchain 10.3-2021.10

Test environment:
Test board: STK
MDK Version: 5.28
IAR Version: 9.20
GCC Version: GNU Arm Embedded Toolchain 10.3-2021.10
================================================================================
使用步骤：
1. 下载并运行程序；
2. 通过USB连接线，一端连接STK板，另一端连接PC电脑；
3. 在PC电脑上打开上位机软件，选择STK板模拟的自定义HID设备；
4. 在上位机软件中开启定时数据接收，可以观察到上位机不断接收到设备发送的databuffer
数组中的数据；
5. 同时通过上位机给设备发送数据更新databuffer数组，可以观察到后续上位机接收到更
新后的数据；

Example execution steps:
1. Download and run the program.
2. Connect one end of the USB cable to the STK board and the other end to the PC.
3. On the PC, open the host computer software and select the custom HID device
emulated by the STK board.
4. In the host computer software, enable timed data reception. You can observe
that the software continuously receives data from the device's databuffer array.
5. Simultaneously, send data to the device via the host computer to update the
databuffer array. You will observe that subsequent data received by the host
computer reflects these updates.

================================================================================
注意事项：
如果需要使用按键:
StartKit版本为V2.0以下,需将StartKit.h中的StartKitVersion 2 注释掉，并打开
StartKitVersion 1
StartKit版本为V2.0及以上版本,则无需操作
1. 在用户测试程序过程中，如果对USB接口进行热插拔，当重新插上USB线到PC端后，有可
能上位机不会再收到数据。这是因为程序在发送新数据之前会检查上一次是否发送成功（通
过检查HID_STATE_BUSY标志位）。如果热插拔过程中导致USB通信失败一次，则会停止发送
数据。为了解决这个问题，您可以取消程序中对HID_STATE_BUSY标志位的判断，这样就可以
实现热插拔不影响数据发送。
2. 通过修改HID_DATA_BUFFER_SIZE的值，可以同时改变接收和发送数据的最大长度，如果
要修改数据接收端点和发送端点的大小，可以分别修改HID_INT_EP_SIZE和HID_OUT_EP_SIZE
的值。
3. 此样例中使用的上位机软件可以在USB中文网中搜索下载自定义HID通讯调试工具。

Notes:
If you need to use buttons:
StartKit version is below V2.0, you need to comment StartKitVersion 2 in
StartKit.h, and open StartKitVersion 1 
StartKit version is V2.0 and above, no operation is required
1. During user testing, if the USB interface is hot-plugged, it is possible 
that the host will no longer receive data after reconnecting the USB cable to 
the PC. This is because the program checks if the previous data transmission 
was successful (by checking the HID_STATE_BUSY flag) before sending new data. 
If there is a USB communication failure during the hot-plug process, data 
transmission will be halted. To address this issue, you can remove the check 
for the HID_STATE_BUSY flag in the program, allowing data transmission to 
continue even after hot-plugging.
2. By modifying the value of HID_DATA_BUFFER_SIZE, the maximum length for both
receiving and transmitting data can be changed simultaneously. If you need to
modify the size of the data reception endpoint and the transmission endpoint
separately, you can change the values of HID_INT_EP_SIZE and HID_OUT_EP_SIZE .
3. The host computer software used in this sample can be searched for and
downloaded as a "Custom HID Communication Debugging Tool" on the USB Chinese
Website .

================================================================================
